package com.china.springServer.desigen.factory.simple_facotry;

public class SimpleCoffeeFactory {

    public Coffee createCoffee(String coffeeType) {
        Coffee coffee = null;
        if (coffeeType.equalsIgnoreCase("latte")) {
            coffee = new LatteCoffee();
        } else if (coffeeType.equalsIgnoreCase("american")) {
            coffee = new AmericanCoffee();
        } else {
            throw new RuntimeException();
        }
        return coffee;
    }

}
